package com.time.timespace.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.time.timespace.commons.constant.BaseConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "评论表")
@TableName("ts_comments")
public class Comments {

    @Schema(description = "表id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "用户ID")
    private Long userId;

    @Schema(description = "标题")
    private String title;

    @Schema(description = "描述")
    private String description;

    @Schema(description = "创建日期")
    @DateTimeFormat(pattern = BaseConstants.Pattern.DATE_TIME)
    @JsonFormat(pattern = BaseConstants.Pattern.DATE_TIME)
    private Date creationDate;

    @Schema(description = "删除标识，Y表示删除，N表示未删除")
    private String deleteFlag;

    @TableField(exist = false)
    private String avatar;

    @TableField(exist = false)
    private String nickName;
}
